<%@ page import="ztc.common.SiginBean" %>
<%@ page import="ztc.common.UserBean" %>
<%@ page import="ztc.service.DBTools" %>
<%@ page import="java.util.List" %>
<%--
  Created by IntelliJ IDEA.
  User: ztc
  Date: 16-4-12
  Time: 下午9:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>统计页面</title>
  <link href="${pageContext.request.contextPath}/css/min.css" rel="stylesheet">
  <link href="${pageContext.request.contextPath}/css/login.css" rel="stylesheet">
  <script src="${pageContext.request.contextPath}/js/jquery.js"></script>
  <script src="${pageContext.request.contextPath}/js/min.js"></script>
  <script src="${pageContext.request.contextPath}/js/my.js"></script>
  <link rel="shortcut icon" type="image/x-icon" href="${pageContext.request.contextPath}/img/favicon.ico" />

</head>
<%
  UserBean userBean= (UserBean) session.getAttribute("userBean");
  List<SiginBean> list=new DBTools().getSiginList(userBean.getId());
  request.setCharacterEncoding("utf-8");
  String msg=request.getParameter("msg");
  if(msg!=null){
%>
<script type="text/javascript">
  alert("<%=msg%>");
</script>
<%
  }
%>
<body>
<div style="position:fixed;top: 20px; background:#ccc;height:50px;width:98%;left:1%;z-index:1;" id="topbar">
  <img src="/img/0.png" height="40px" style="position: relative;top: 10%;left: 5%;z-index: 2;">
  <img src="/img/135-round.png" height="40px" style="position: relative;top: 10%;">
  <img src="/img/435-round.png" height="40px" style="position: relative;top: 10%;">
  <label style="position: relative;top: 20%;">×××××××××× ××××××××××</label>
  <a href="/qr/issuance.jsp"><label style="position: relative;top: 20%;left:10%;">发布签到</label></a>
  <a href="/qr/showmem.jsp"><label style="position: relative;top: 20%;left:20%;">查看未保存布签到</label></a>
  <a href="/qr/showinf.jsp"><label style="position: relative;top: 20%;left:30%;">查看已保存布签到</label></a>
  <label style="position: relative;top: 20%;left:45%;" >
    <%=(session.getAttribute("userBean")==null?"<a href=\"/users/register.jsp\">注册</a>":"用户："+((UserBean)session.getAttribute("userBean")).getName())+"<a href=\"/users/logout\">注销</a> "%></label>
</div>
<div class="container-fluid" style="position: relative;top:40px;">
  <div class="row-fluid">
    <div class="span12">
      <div class="row-fluid">
        <div style="float:left;width:30%;" align="center">
          <fieldset>
            <legend>个人信息</legend>
            <table class="table" id="table">
              <tr align="center"><td><B>姓名:</B></td><td><%=userBean.getName()%></td></tr>
              <tr align="center"><td><B>性别:</B></td><td><%=userBean.getSex()%></td></tr>
              <tr align="center"><td><B>Email:</B></td><td><%=userBean.getEmail()%></td></tr>
              <tr align="center"><td><B>QQ:</B></td><td><%=userBean.getQq()%></td></tr>
              <tr align="center"><td><B>微信:</B></td><td><%=userBean.getWeixin()%></td></tr>
              <tr align="center"><td><B>电话:</B></td><td><%=userBean.getPhone()%></td></tr>
            </table>
          </fieldset>
        </div>
        <div style="float:left;width:70%" align="center">
          <fieldset >
            <legend>已发布签到</legend>
            <table class="table" width="80%">
              <tr align="center"><td><B>操作</B></td><td><B>签到人数</B></td><td><B>签到名称</B></td><td><B>二维码大小</B></td><td><B>二维码前景色</B></td><td><B>二维码背景色</B></td><td><B>发布时间</B></td></tr>
              <%
                for(SiginBean s:list){
                  out.println("<tr align=\"center\">");
                  out.println("<td><a href=\"/qr/del?id="+s.getId()+"\">[删除]</a></td>");
                  out.println("<td>"+new DBTools().getSiginSumBySiginID(s.getId())+"</td>");
                  out.println("<td><a href=\"/qr/showstu.jsp?name="+s.getSname()+"&id="+s.getId()+"\">");
                  out.println(s.getSname());
                  out.println("</a></td>");
                  out.println("<td>"+s.getSize()+"</td>");
                  out.println("<td>"+s.getForeground()+"</td>");
                  out.println("<td>"+s.getBackground()+"</td>");
                  out.println("<td>"+s.getTime()+"</td>");
                  out.println("</tr>");
                }
              %>
            </table>
          </fieldset>
        </div>
      </div>
    </div>
  </div>
</div>
</body>
</html>
